{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>  <strong> 会员列表 </strong> </li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
	<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('index')}">	
		<div class="form-group" style="padding-left: 10px;">
				用户名称 <input type="text" id="name" name="name" value="" placeholder="请输入用户名称" class="bank"/>
				手机号码 <input type="text" id="mobile" name="mobile" value="" placeholder="请输入手机号" class="bank" />
				开始时间 <input id='start_time' name='add_time'style="width: 100px;"  onclick='WdatePicker()' type='text' placeholder="开始时间" class="bank" />
				至<input id='end_time' name='end_time'  style="width: 100px;" onclick='WdatePicker()' type='text' placeholder="结束时间" class="bank" />
				<select name="status" class="bank" > 
         				<option value="2">请选择用户状态</option>
                        <option value="1">激活</option>
                        <option value="0">未激活</option>
                </select>
				<span ><button type="submit" class="btn btn-sm btn-primary"><li class="fa fa-search"> 查询</li></button> </span>				
		</div>
		</from>
		<div class="hr-line-dashed" style="margin: 3px;"></div>
		<a href="{:url('export')}" class="btn btn-xs btn-primary">导出会员信息</a>
		<div class="example-wrap">
			<div class="example">
				<form method="post" action="{:url('index')}">
					<table class="table table-bordered table-hover">
						<thead>
							<tr class="long-th">
								<th>用户ID</th>
								<th>姓名</th>
								<th>手机号码</th>
								<th style="width:70px;">余额</th>
								<th style="width:70px;">果币</th>
								<th>创建时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{foreach name="list" item="vo"}
							<tr>
								
								<td class="text-center">{$vo.id}</td>
								<td class="text-center">{$vo.nick_name}</td>
								<td class="text-center">{$vo.mobile}</td>
								<td class="text-center">{$vo.credit2}
									<input type="button" value="充值" id="credit2"class="btn btn-primary bnt-sm" onclick="balance({$vo.id})">
								</td>
								<td class="text-center">{$vo.credit1}
									<input type="button" value="充值" id="credit1"class="btn btn-primary bnt-sm" onclick="integral({$vo.id})">
								</td>
								<td class="text-center">{$vo.add_time}</td>
								<td class="text-center">
									{if $vo.status == 0}
	                        			<a href="{:url('edit',['id'=>$vo.id, 'status'=>$vo.status])}" class="btn btn-primary bnt-sm ajax-do">
										<i class="fa fa-paste"></i>激活   
	                        			{else}
	                        			<a href="{:url('edit',['id'=>$vo.id, 'status'=>$vo.status])}" class="btn btn-danger bnt-sm ajax-do">
										<i class="fa fa-paste"></i>冻结   
	                        			{/if}</a>
									<a href="{:url('update',['id'=>$vo.id])}" class="btn btn-primary bnt-sm">
										<i class="fa fa-paste"></i> 编辑</a>
									
								</td>
							</tr>
							{/foreach}
						</tbody>
					</table>
					<div style="text-align: right;">
                   		{$list->render()}
                    </div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script>
	$(function() {
		$("#myForm").validate({
			rules: {
				
			},
			messages: {
				
			},
			
		});
	});
	
	function balance(id){
		var tel=parent.layer.prompt({title: '输入充值金额',formType: 0}, 
	    function(integral){layer.open({content: '确认充值金额为'+integral+'？',
					btn: ['确认', '取消'],yes: function(index, layero) {window.location.href='credit/id/'+id+'/integral/'+integral;},
													btn2: function(index,layero) {},
						                        cancel: function() {
						                            //右上角关闭回调  
						                      }
				});
		});
	}
	function integral(id){
		var tel=parent.layer.prompt({title: '输入充值积分',formType: 0}, 
	    function(integral){layer.open({content: '确认充值积分为'+integral+'？',
					btn: ['确认', '取消'],yes: function(index, layero) {window.location.href='integral/id/'+id+'/integral/'+integral;},
													btn2: function(index,layero) {},
						                        cancel: function() {
						                            //右上角关闭回调  
						                      }
				});
		});
	}

</script>
<style>
.bank{
	width: 150px;
    height:30px;
    text-align:center;
    border-radius:5px;
    display:inline;
}
</style>
{/block}
